<template>
<div>
  <div>加法组件={{this.$store.state.m_cart.count}}</div>
  <button @click="handle1()">+1</button>
  <button @click="handle2()">+1</button>
  <button @click="handle3()">+10</button>
  <button @click="handle4">天气</button>
</div>
</template>

<script>
export default {
methods:{
  handle1(){
    // 不推荐直接操作 变量
    this.$store.state.count ++;
  },
  handle2(){
    this.$store.commit('m_cart/add')
  },
  handle3(){
     this.$store.commit('m_cart/add',10)
  },
  handle4(){
    // 异步调试
    this.$store.dispatch('m_cart/testajax');
  }
}
}
</script>

<style>

</style>